home *** CD-ROM | disk | FTP | other *** search
- package com.ibm.xml.parser;
-
- import java.io.Serializable;
-
- public class ExternalID implements Serializable {
- static final long serialVersionUID = 4611817161873481189L;
- private static final int T_SYSTEM = 0;
- private static final int T_PUBLIC = 1;
- int type = 1;
- String publicID;
- String systemID;
-
- public ExternalID(String var1) {
- this.type = 0;
- this.publicID = null;
- this.systemID = var1;
- }
-
- public ExternalID(String var1, String var2) {
- this.type = 1;
- this.publicID = var1;
- this.systemID = var2;
- if (this.publicID == null) {
- this.type = 0;
- }
-
- }
-
- public boolean isSystem() {
- return this.type == 0;
- }
-
- public boolean isPublic() {
- return this.type == 1;
- }
-
- public String getSystemLiteral() {
- return this.systemID;
- }
-
- public String getPubidLiteral() {
- return this.publicID;
- }
-
- public String toString() {
- String var1;
- if (this.isSystem()) {
- var1 = "SYSTEM \"" + this.getSystemLiteral() + "\"";
- } else if (this.getSystemLiteral() != null) {
- var1 = "PUBLIC \"" + this.getPubidLiteral() + "\" \"" + this.getSystemLiteral() + "\"";
- } else {
- var1 = "PUBLIC \"" + this.getPubidLiteral() + "\"";
- }
-
- return var1;
- }
-
- public boolean equals(Object var1) {
- if (var1 == null) {
- return false;
- } else if (!(var1 instanceof ExternalID)) {
- return false;
- } else {
- ExternalID var2 = (ExternalID)var1;
- if (var2.publicID == null && this.publicID == null || var2.publicID != null && var2.publicID.equals(this.publicID)) {
- return var2.systemID == null && this.systemID == null || var2.systemID != null && var2.systemID.equals(this.systemID);
- } else {
- return false;
- }
- }
- }
-
- public int hashCode() {
- int var1 = 0;
- if (this.publicID != null) {
- var1 = this.publicID.hashCode();
- }
-
- if (this.systemID != null) {
- var1 += this.systemID.hashCode();
- }
-
- return var1;
- }
- }
-